package yesjava;

import java.io.*;
import java.util.Scanner;

public class Main2 {
    // 以字符流的形式读取 子节流中的数据
    public static void main(String[] args) throws Exception {
        InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("mymy/my.txt");
        Reader reader = new InputStreamReader(in,"UTF-8");//把 字节流 转成 字符流
        BufferedReader bufferedReader = new BufferedReader(reader);
//        String path = "mymy/my.txt";
//        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(path)));
        while (true){
            String line = bufferedReader.readLine();
            if(line==null){
                break;
            }
            System.out.println(line);
        }
        in.close();
    }
}
